<?php

// +----------------------------------------------------------------------
// | Workman and Gateway-worker
// +----------------------------------------------------------------------
// | Copyright (c) 2015-2025 http://www.yicmf.com, All rights reserved.
// +----------------------------------------------------------------------
// | Author: 微尘 <yicmf@qq.com>
// +----------------------------------------------------------------------

return [
    'http'       => [
        'enable'     => false,
        'host'       => '0.0.0.0',
        'port'       => 8080,
        'count' => 1,
        'options'    => [],
    ],
    'gateway'  => [
        'enable'        => false,
        // Register配置
        'registerAddress' => '127.0.0.1:1238',
        // 扩展自身需要的配置
        'protocol' => 'websocket', // 协议 支持 tcp udp unix http websocket text
        'host' => '0.0.0.0', // 监听地址
        'port' => 2345, // 监听端口
        'socket' => '', // 完整监听地址
        'context' => [], // socket 上下文选项
        'register'=>[
            'deploy' => true, // 是否需要部署register
        ],
        'gateway'=>[
            // Gateway配置
            'name' => 'gateway',
            'count' => 1,
            'lanIp' => '127.0.0.1',
            'startPort' => 2000,
            'daemonize' => false,
            'pingInterval' => 50,
            'pingNotResponseLimit' => 1,
            'pingData' => '{"type":"ping"}',
            'ping_interval' => 25000,
            'ping_timeout'  => 60000,

        ],
        'business'=>[
            // BusinsessWorker配置
            'name' => 'BusinessWorker',
            'count' => 1,
            'handler' => \yicmf\worker\handler\Gateway::class,
        ],
    ],
    'server'  => [
        'enable'        => false,
        // 扩展自身需要的配置
        'name'           => 'server',
        'count'          => 1,//window仅支持1
        'protocol'       => 'websocket', // 协议 支持 tcp udp unix http websocket text
        'host'           => '0.0.0.0', // 监听地址
        'port'           => 2345, // 监听端口
        'handler'   =>\yicmf\worker\handler\Server::class, // 参考类  \yicmf\worker\handler\Server::class

    ],
    //队列
    'queue'      => [
        'enable'  => false,
        'count' => 1,
        'workers' => [],
    ],
    //计划任务
    'plan'      => [
        'enable'  => true,
        'name'           => 'plan',
        'count'          => 5,//window仅支持1
        'handler'   =>\yicmf\worker\handler\Plan::class, // 参考类  \yicmf\worker\handler\Plan::class
    ],
    'hot_update' => [
        'enable'  => env('APP_DEBUG', false),
        'ext'    => ['php'],
        'include' => [app_path(), root_path('route')],
    ],
];
